<template>
	<mylog ref="mylog" @ok="ok" @close="cancel">
		<template #center>
			<el-form ref="form" :model="form" :rules="rules" label-width="300px" label-position="top" :disabled="showBtn">
				<el-row :gutter="20">
					<el-col :span="spanNumber">
						<el-form-item label="评分项名称" prop="pfName">
							<el-input v-model="form.pfName" placeholder="请输入评分项名称" />
						</el-form-item>
					</el-col>
					<el-col :span="spanNumber">
						<el-form-item label="占分标准(每次)" prop="pfNumber">
							<el-input-number v-model="form.pfNumber" style="width: 100%;" placeholder="请输入占分" />
						</el-form-item>
					</el-col>
					<el-col :span="spanNumber">
						<el-form-item label="减分标准(每次)" prop="pfJianNumber">
							<el-input-number v-model="form.pfJianNumber" style="width: 100%;" placeholder="请输入减分标准" />
						</el-form-item>
					</el-col>
					<el-col :span="spanNumber">
						<el-form-item label="评估责任单位" prop="pfDept">
							<el-input v-model="form.pfDept" type="textarea" placeholder="请输入评估责任单位" />
						</el-form-item>
					</el-col>
					<el-col :span="spanNumber">
						<el-form-item label="评分描述" prop="remark">
							<el-input v-model="form.remark" type="textarea" placeholder="请输入评分描述" />
						</el-form-item>
					</el-col>
				</el-row>
			</el-form>
		</template>
	</mylog>
</template>

<script>
	import {
		getAction,
		postAction,
		editAction,
		removeAction,
		detailAction,
	} from "@/api/api";
	import mylog from '@/views/components/mylog.vue'
	export default {
		dicts: [],
		components: {
			mylog,
		},
		name: "renwu",
		data() {
			return {
				showBtn:false,
				spanNumber: 24,
				form: {},
				rules: {
					pfName: [{
						required: true,
						message: '请输入评分项名称',
						trigger: 'blur'
					}],
					pfNumber: [{
						required: true,
						message: '请输入占分',
						trigger: 'blur'
					}],
					pfJianNumber: [{
						required: true,
						message: '请输入减分标准',
						trigger: 'blur'
					}],
					pfDept: [{
						required: true,
						message: '请输入评估责任单位',
						trigger: 'blur'
					}],
					remark: [{
						required: true,
						message: '请输入评分描述',
						trigger: 'blur'
					}],
				},
			};
		},
		created() {},
		methods: {
			ok() {
				console.log(this.form)
				this.$refs.form.validate((valid) => {
					if (valid) {
						this.$emit('ok', this.form)
						this.form = {}
						this.$refs.mylog.cancel()
					} else {
						this.$refs.mylog.loading = false
					}
				});
			},
			cancel() {
				this.form = {}
				this.open = false;
				this.title = null
			}
		}
	};
</script>
<style scoped lang="scss">
	.title-box {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 30px;

		>span {
			font-weight: 500;
			font-size: 18px;
			line-height: 30px;
		}

	}

	.center-box {

		height: calc(100% - 60px);
	}
</style>